#ifndef HEARTBESTCMD_H
#define HEARTBESTCMD_H

#include "Command/BaseCmd.h"
#include "Protocol/CloudProtocol.h"
#include "File/Xml/BaseXml.h"


class HeartBestCmd : public BaseCmd
{
    Q_OBJECT

public:

    enum{FunctionCode = CloudProtocol::HeartBest};

    Q_INVOKABLE explicit HeartBestCmd(QObject *parent = 0);

    Package toPackage();
    void unPackage(Package package);

    QByteArray MAC() const;
    QByteArray BODY() const;
    QByteArray ProgramNum() const;
    quint16 Typenum() const;
    QByteArray Errornum() const;
    quint16 EquimentID() const;
    void SetMAC(QByteArray MAC);
    void SetProgramNum(QByteArray programNum);
    void SetID(const quint16 &EquipmentID);
    void SetTypenum(const quint16 &Type);
    void SetErrornum(QByteArray errornum);

private:

    QByteArray m_Mac;
    QByteArray m_ProgramNum;
    quint16 m_Type;
    QByteArray m_ErrorNum;
    quint16 m_EquipmentID;
    quint16 m_address;
    quint16 m_value;
    QByteArray m_body;

};

class HeartBestData
{
public:
    QByteArray MAC() const;
    QByteArray ProgramNum() const;
    quint16 Typenum() const;
    QByteArray Errornum() const;
    quint16 EquimentID() const;
    void SetMAC(QByteArray MAC);
    void SetProgramNum(QByteArray programNum);
    void SetID(const quint16 &EquipmentID);
    void SetTypenum(const quint16 &Type);
    void SetErrornum(QByteArray errornum);

private:QByteArray m_Mac;
        QByteArray m_ProgramNum;
        quint16 m_Type;
        QByteArray m_ErrorNum;
        quint16 m_EquipmentID;
        quint16 m_address;
        quint16 m_value;
};

class HeartBestList
{
public:
    QList<HeartBestData> m_HeartBestDataList;
    static HeartBestList*  GetInstance()
    {
        if(m_pInstancelist ==NULL)
        {
            m_pInstancelist=new HeartBestList();
        }
        return m_pInstancelist;
    }


private:
    HeartBestList(){}
    static HeartBestList * m_pInstancelist;
};

#endif // HEARTBESTCMD_H
